package website.lucaswork.survey.core.utils;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class DefaultValues {

    @Value("${survey.default.cover}")
    private String defaultCoverUrl;

    public String getDefaultCoverUrl() {
        return this.defaultCoverUrl;
    }

    @Value("${survey.default.backend.url}")
    private String backendUrl;

    /**
     * @return the backend url always with slash end
     */
    public String getBackendUrl() {
        if (!backendUrl.endsWith("/")) {
            return backendUrl + "/";
        }
        return backendUrl;
    }

    @Value("${survey.default.date.format}")
    private String defaultDateFormat;

    public String getDefaultDateFormat() {
        return this.defaultDateFormat;
    }

    @Value("${survey.default.datetime.format}")
    private String defaultDatetimeFormat;

    public String getDefaultDatetimeFormat() {
        return this.defaultDatetimeFormat;
    }

    @Value("${survey.default.boolean.true.text}")
    private String defaultTrueText;

    public String getDefaultTrueText() {
        return this.defaultTrueText;
    }

    @Value("${survey.default.boolean.false.text}")
    private String defaultFalseText;

    public String getDefaultFalseText() {
        return this.defaultFalseText;
    }

    @Value("${survey.default.datetime.format.js}")
    private String defaultDatetimeFormatForJs;

    public String getDefaultDatetimeFormatForJs() {
        return defaultDatetimeFormatForJs;
    }
}
